<?php
require_once $_SERVER['DOCUMENT_ROOT'].'/entities/Person.php';
require_once $_SERVER['DOCUMENT_ROOT'].'/model/DAO/mysql/filters/Filter.php';

class DepartmentPersonFilter implements Filter {
	private $person;

	public function __construct(Person $person) {
		$this->person = $person;
	}

	public function apply($entity) {
		$head = $entity->getHead();
		if($head != null) {
			return $head->getPerson()->getIdentity() === $this->person->getIdentity();
		}
		return false;
	}
}
?>